#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define vec vector < int > 
#define pb push_back
#define y1 y_alpha_1

using namespace std;

using ll = long long;
using db = double;
using pii = pair<int,int>;

int read() {
	int x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-',ch = getchar();
	while(isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48),ch = getchar();
	return f ? -x : x;
}

const int N = 1e3 + 10;

int n,m;

struct ve {
	int x,y;
	ve (int _x = 0,int _y = 0) : x(_x),y(_y) {}
	friend ve operator - (ve a,ve b) { return ve(a.x - b.x,a.y - b.y); }
	friend ve operator + (ve a,ve b) { return ve(a.x + b.x,a.y + b.y); }
	friend ll operator * (ve a,ve b) { return (ll) a.x * b.x + (ll) a.y * b.y; }
	friend ll operator ^ (ve a,ve b) { return (ll) a.x * b.y - (ll) a.y * b.x; }
}a[10],b[N];

vector < int > g[10][N];

bool v[10];
int t[N],tim,nu[N],tot;

bool dc(int goal) {
	if((++tot) > n) return 0;
	if(g[nu[tot]][goal].size() == 0) { t[goal] = tim; return 1; }
	int x = tot;
	for(auto y : g[nu[x]][goal])
		if(t[y] != tim) {
			if(!dc(y)) return 0;
		}
	t[goal] = tim; return 1;
}

bool check(int goal) { tim++; tot = 0; return dc(goal); }

bool dfs(int x,int y) {
	if(x == n + 1) return check(y);
	for(int i = 1;i <= n;i++)
		if(!v[i]) { v[i] = 1; nu[x] = i; if(dfs(x + 1,y)) return 1; v[i] = 0; }
	return 0;
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in,m = in;
	for(int i = 1;i <= n;i++) a[i].x = in,a[i].y = in;
	for(int i = 1;i <= m;i++) b[i].x = in,b[i].y = in;
	for(int i = 1;i <= n;i++)
		for(int j = 1;j <= m;j++)
			for(int k = 1;k <= m;k++)
				if(j != k && ((a[i] - b[j]) ^ (a[i] - b[k])) == 0 && (a[i] - b[j]) * (b[j] - b[k]) > 0) g[i][k].pb(j);
	int ans = 0;
	for(int i = 1;i <= m;i++) { memset(v,0,sizeof v); if(dfs(1,i)) ans++; }
	printf("%d\n",ans);
	return 0;
}
